package cn.net.xyan.pay.core

import cn.net.xyan.pay.core.dto.CreateOrderReq
import cn.net.xyan.pay.core.dto.UpdateOrderReq
import com.fasterxml.jackson.databind.ObjectMapper
import org.junit.Test
import java.math.BigDecimal

/**
 * Created by zarra on 2017/3/24.
 */

class DTOTest{

    @Test
    fun test1():Unit{
        var r = CreateOrderReq("orderTestId",2.0)

        //r.fee = BigDecimal.valueOf(1.5)

        val om = ObjectMapper()

        val json = om.writeValueAsString(r)

        var r2 = om.readValue(json,CreateOrderReq::class.java)

        println("r2: "+om.writeValueAsString(r2))
    }
}